package com.augurit.gzcgwsp.mail;

import java.util.TimerTask;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.augurit.gzcgwsp.mail.service.ISendMailService;
import com.augurit.gzcgwsp.mail.service.ISendOaService;

/**
 * 定时发送邮件类
 * @author Administrator
 *
 */
public class SendMailTimer extends TimerTask{ 
	private static final Logger logger=Logger.getLogger( SendMailTimer.class);
	@Autowired
	private ISendMailService sendMailService;
	@Autowired
	private  ISendOaService  sendOaService;
	@Override
	public void run() {
		logger.info("邮件和oa定时器开始启动..........");
		try {
//			sendMailService.insertMail();//先插入邮件
//			sendMailService.send();//删除邮件
//			
		//	sendOaService.sendDoc();//发送文件
		} catch (RuntimeException e) {
			logger.error("邮件和oa定时器失败.........."+e);
		}
		
		logger.info("邮件和oa定时器结束..........");
	}

}
